package com.xykj.enterprise.wechat.event.service.ext;

import com.xykj.enterprise.wechat.bean.ext.identity.SuiteAccessToken;
import com.xykj.enterprise.wechat.event.config.ExtClient;

import java.util.HashMap;
import java.util.Map;

/**
 * suite_access_token 工具
 *
 * @Author zhouxu
 * @create 2021-04-02 16:39
 */
public class SuiteAccessTokenUtil {

    /**
     * suite_access_token
     *
     * @param extClient
     * @param suiteId
     * @param suiteSecret
     * @param suiteTicket
     * @return
     */
    public static SuiteAccessToken get(ExtClient extClient, String suiteId, String suiteSecret, String suiteTicket) {
        Map param = new HashMap();
        param.put("suite_id", suiteId);
        param.put("suite_secret", suiteSecret);
        param.put("suite_ticket", suiteTicket);
        return extClient.get("GetSuiteAccessToken", param, SuiteAccessToken.class);
    }
}
